package com.example.springproject.xuwsh.service;

import com.example.xuwsh.redis.XuwshRedisTool;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: xuwsh
 * @Date: 2023/04/18/16:49
 * @Description:
 */
@Service
public class RedisTestService {
    @Resource
    public XuwshRedisTool redisTool;

    public void setCacheObject(String name, String xuwsh) {
        redisTool.handleWithLock(name, o -> {
            System.out.println("存在key");
        }, o -> {
            System.out.println("key不存在");
        });
    }
}
